hysop.backend.device.opencl.operator.solenoidal_projection module

class hysop.backend.device.opencl.operator.solenoidal_projection.OpenClSolenoidalProjection(input_field, output_field, variables, input_field_div=None, output_field_div=None, **kwds)[source]

Bases: SolenoidalProjectionOperatorBase, OpenClSymbolic

Solves the poisson rotational equation using clFFT and an OpenCL symbolic kernels.

SolenoidalProjection projects a 3D vector field onto the space of divergence free fields.

Parameters:
  • input_field (Field) – Field to be projected.

  • output_field (:class:`~hysop.fields.continuous_field.Field) – Solution field.

  • input_field_div (Field, optional) – Optionally compute input field divergence.

  • output_field_div (Field, optional) – Optionally compute output field divergence.

  • variables (dict) – dictionary of fields as keys and topologies as values.

  • kwds – base class parameters.

apply(**kwds)

Abstract method that should be implemented. Applies this node (operator, computational graph operator…).

initialize(**kwds)[source]

Initialize this node.

Initialization step sets the following variables:

*self.method, *self.input_field_requirements *self.output_field_requirements *self.initialized

It returns self.method.

Order of execution is:

self.pre_initialize() self._setup_method() self.handle_method() self.get_field_requirements() self._initialized = True self.post_initialize()

See ComputationalGraphNode.handle_method() to see how user method is handled. See ComputationalGraphNode.get_field_requirements() to see how topology requirements are handled.

After this method has been handled by all operators, initialization collects min and max ghosts required by each operators which will be usefull in the discretiezation step to automatically build topologies or check against user supplied topologies.

This function also sets the self.initialized flag to True (just before post initialization). Once this flag is set one may call ComputationalGraphNode.discretize().

setup(work)[source]

Setup temporary buffer that have been requested in get_work_properties(). This function may be used to execute post allocation routines. This sets self.ready flag to True. Once this flag is set one may call ComputationalGraphNode.apply() and ComputationalGraphNode.finalize().

Automatically honour temporary field memory requests.